<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSiteLocationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_site_locations', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo', 65)->default('')->comment('主订单号');
            $table->unsignedInteger('mainProcessId')->default(0)->comment('开店主流程id');
            $table->unsignedTinyInteger('messageFrom')->default(0)->comment('门店信息来源 1：加盟商自带 2 夸父推荐 3：加盟商自带址-远程 4：迁址');
            $table->string('longitude')->default('')->comment('门店经度');
            $table->string('latitude')->default('')->comment('门店纬度');
            $table->string('siteAddress', 64)->default('')->comment('经纬度地址');
            $table->string('cityArea', 64)->default('')->comment('门店城市');
            $table->unsignedInteger('provinceCode')->default(0)->comment('省code');
            $table->unsignedInteger('cityCode')->default(0)->comment('市区code');
            $table->unsignedInteger('areaCode')->default(0)->comment('地区code');
            $table->unsignedTinyInteger('cityType')->default(0)->comment('1 一线 2 二线 3 三线 4 四线');
            $table->string('address', 64)->default('')->comment('门店地址-连起来的');
            $table->unsignedInteger('selectTime')->default(0)->comment('选址时间');
            $table->unsignedTinyInteger('currentFormat')->default(0)->comment('当前业态0 其它 1：空置中2餐饮店3奶茶店4服装店5便利店6理发店');
            $table->unsignedTinyInteger('operatingStatus')->default(0)->comment('当前经营状态');
            $table->unsignedTinyInteger('leaseStatus')->default(0)->comment('当前租赁状态');
            $table->string('driveType', 20)->default('')->comment('客流驱动类型 逗号隔开');
            $table->unsignedTinyInteger('siteType')->default(0)->comment('店址类型');
            $table->unsignedTinyInteger('flowLine')->default(0)->comment('人流动线');
            $table->unsignedTinyInteger('orientation')->default(0)->comment('朝向');
            $table->unsignedTinyInteger('yinYangJie')->default(0)->comment('阴阳街');
            $table->unsignedTinyInteger('visualLabel')->default(0)->comment('可视化标签');
            $table->unsignedTinyInteger('streetLength')->default(0)->comment('商业街长度');
            $table->unsignedTinyInteger('decorationShopType')->default(0)->comment('装修店型');
            $table->float('doorWidth', 6, 2)->default(0)->comment('门宽');
            $table->float('shopWidth', 6, 2)->default(0)->comment('店宽');
            $table->float('floorHeight', 6, 2)->default(0)->comment('层高');
            $table->float('depth', 6, 2)->default(0)->comment('进深');
            $table->float('area', 6, 2)->default(0)->comment('面积');
            $table->float('electricityConsumption', 6, 2)->default(0)->comment('用电量');
            $table->unsignedTinyInteger('isCapacityIncrease')->default(0)->comment('是否电量增容 0 默认 1 是 2 否');
            $table->unsignedInteger('capacityIncreaseFee')->default(0)->comment('电量增容费用');
            $table->float('exhaustAirVolume', 6, 2)->default(0)->comment('排风量');
            $table->unsignedTinyInteger('isExhaustReconstruction')->default(0)->comment('排风改造 0 默认 1 是 2 否');
            $table->float('upperWaterDiameter', 6, 2)->default(0)->comment('上水管径');
            $table->float('lowerWaterDiameter', 6, 2)->default(0)->comment('下水管径');
            $table->unsignedTinyInteger('isReformWater')->default(0)->comment('是否支持上下水管径改造 0 默认 1 是 2 否');
            $table->unsignedTinyInteger('airConditionerCType')->default(0)->comment('空调类型 1 甲方空调 2 自设空调');
            $table->unsignedTinyInteger('isFireControl')->default(0)->comment('安防 0 默认 1 是 2 否');
            $table->unsignedTinyInteger('adSpaceNumber')->default(0)->comment('广告位数量');
            $table->unsignedTinyInteger('rentType')->default(0)->comment('记租类型1固租2只提点3固租+提点4两者取最高');
            $table->unsignedInteger('fixedRent')->default(0)->comment('固定租金');
            $table->float('remind', 7, 4)->default(0)->comment('提点百分比');
            $table->unsignedTinyInteger('rentPaymentCycle')->default(0)->comment('1月付2季付3半年付4年付');
            $table->unsignedInteger('deposit')->default(0)->comment('押金');
            $table->unsignedInteger('leaseTerm')->default(0)->comment('租期');
            $table->unsignedInteger('rentFreePeriod')->default(0)->comment('免租期');
            $table->unsignedTinyInteger('caseRegisterType')->default(0)->comment('收银机类型 1夸父收银 2 商场收银');
            $table->unsignedInteger('waterFee')->default(0)->comment('水费');
            $table->unsignedInteger('electricityFee')->default(0)->comment('电费');
            $table->unsignedInteger('propertyFee')->default(0)->comment('物业费');
            $table->unsignedInteger('mobilizationMobile')->default(0)->comment('进场联系人');
            $table->unsignedInteger('mobilizationFee')->default(0)->comment('进场费');
            $table->string('mobilizationFeeDesc')->default('')->comment('进场费说明');
            $table->unsignedInteger('bond')->default(0)->comment('保证金');
            $table->unsignedInteger('manageFee')->default(0)->comment('管理费');
            $table->unsignedInteger('sponsorshipFee')->default(0)->comment('赞助费');
            $table->unsignedInteger('promotionFee')->default(0)->comment('推广费');
            $table->unsignedInteger('otherFee')->default(0)->comment('其它费用');
            $table->string('otherFeeDesc')->default('')->comment('其它费用说明');
            $table->string('leaseMobile', 20)->default('')->comment('店面出租联系方式');
            $table->string('leaseName', 64)->default('')->comment('店面出租联系人');
            $table->string('leaseWeChat', 64)->default('')->comment('店面出租微信');
            $table->unsignedTinyInteger('businessStrategy')->default(0)->comment('1:加盟商亲管2：合伙经营 3：店长代管');
            $table->string('restrictedSales', 64)->default('')->comment('产品限制销售范围,逗号隔开');
            $table->string('developConsultantName', 64)->default('')->comment('开发顾问名称');
            $table->unsignedBigInteger('developConsultantId')->default(0)->comment('开发顾问id');
            $table->string('siteAdvantage')->default('')->comment('店址优势');
            $table->string('siteInferiority')->default('')->comment('店址劣势');
            $table->unsignedInteger('openTime')->default(0)->comment('预计开业时间');
            $table->unsignedTinyInteger('status')->default(0)->comment('0默认 1 已通过 2 已驳回');
            $table->unsignedTinyInteger('siteStatus')->default(0)->comment('0待选址1待提交2已提交3待修改4已完成');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除 1是 0 否');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '选址表单';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_site_locations');
    }
}
